using System;
using System.Collections.Generic;
using System.Linq;

namespace WB.Mvc.Forms
{
	public class ModelFieldGroupStrategyProvider : IFieldGroupStrategyProvider
	{
		private readonly IList<IFieldStrategy> fieldStrategies;

		public ModelFieldGroupStrategyProvider(params IFieldStrategy[] fieldStrategies)
		{
			this.fieldStrategies = fieldStrategies;
		}

		public IFieldGroupStrategy GetStrategy(object model)
		{
			return new ModelFieldGroupStrategy(fieldStrategies.ToArray());
		}
	}
}